﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<script type="text/javascript">
    var status = '@ViewBag.status';
    var number = '@ViewBag.number';
    $(function () {
        initControl();
    });
    function initControl() {
        if (status == 'U') {
            if ($('#oldEntity').val() != '') {
                var data = JSON.parse($('#oldEntity').val());
                setDataByJson("#form1", data);
            }
            $('#UnitNO').prop("readonly", true);
        }
        initBindSelect("#form1");
    }
    function btn_ok() {
        submitForm();
    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/MainData/LogisticsInfo/SubmitLogisticsInfoForm?status=" + status + "&keyValue=" + number,
            param: $("#form1").formSerialize(),
            success: function (result) {
                if (status == 'I') {
                    parent.reloadGrid(result.data);
                } else {
                    parent.reloadGrid();
                }
                parent.$.detailClose();
            }
        })
    }
    function btn_cancel() {
        parent.$.detailClose();
    }
</script>
<div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    <input id="oldEntity" type="hidden" value="@ViewBag.oldEntity" />
    <div class="ui-layout-center">
        <form id="form1">
            <div style="width:950px;margin:0 auto;">
                <table class="form" style="width:900px;text-align:right;margin:15px;border-bottom:2px solid #ccc;">
                    <tr>
                        <td class="formValue input-width-185" style="width:500px;padding-left:100px;text-align:left;">
                            &nbsp;
                        </td>
                        <td style="width: 300px; padding: 5px 10px;">
                            <div class="btn-group" style="margin-right:20px;">
                                <a id="" class="btn btn-primary center-block" onclick="btn_ok()"><span class="glyphicon glyphicon-ok"></span> 确认</a>
                            </div>
                            <div class="btn-group">
                                <a id="" class="btn btn-primary center-block" onclick="btn_cancel()"><span class="glyphicon glyphicon-remove"></span> 取消</a>
                            </div>
                        </td>
                    </tr>
                </table>
                <table class="form" style="width: 900px;margin:0 15px;" >
                    <tr>
                        <th class="formTitle" style="width:80px;">单位编码</th>
                        <td class="formValue input-width-210" style="width:480px;">
                            <input id="UnitNO" name="UnitNO" type="text" class="form-control required" value="" />
                            <input id="UnitID" name="UnitID" type="hidden" value="" />
                        </td>
                        <th class="formTitle" style="width:80px;">&nbsp;</th>
                        <td class="formValue" style="">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">单位全称</th>
                        <td class="formValue input-width-480">
                            <input id="UnitFullName" name="UnitFullName" type="text" class="form-control required" value="" />
                        </td>
                        <th class="formTitle">单位简称</th>
                        <td class="formValue input-width-185">
                            <input id="UnitShortName" name="UnitShortName" type="text" class="form-control" value="" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">负责人员</th>
                        <td class="formValue input-width-210">
                            <input id="ResponUser" name="ResponUser" type="text" class="form-control" value="" />
                        </td>
                        <th class="formTitle">&nbsp;</th>
                        <td class="formValue" style="">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">联系人员</th>
                        <td class="formValue input-width-210">
                            <input id="ContactUser" name="ContactUser" type="text" class="form-control" value="" />
                        </td>
                        <th class="formTitle">&nbsp;</th>
                        <td class="formValue" style="">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">联系电话</th>
                        <td class="formValue input-width-240">
                            <input id="ContactPhone" name="ContactPhone" type="text" class="form-control" value="" />
                        </td>
                        <th class="formTitle">&nbsp;</th>
                        <td class="formValue" style="">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">联系传真</th>
                        <td class="formValue input-width-240">
                            <input id="ContactFax" name="ContactFax" type="text" class="form-control" value="" />
                        </td>
                        <th class="formTitle">&nbsp;</th>
                        <td class="formValue" style="">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">联系信箱</th>
                        <td class="formValue input-width-320">
                            <input id="ContactEMail" name="ContactEMail" type="text" class="form-control" value="" />
                        </td>
                        <th class="formTitle">&nbsp;</th>
                        <td class="formValue" style="">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">联系地址</th>
                        <td class="formValue input-width-480">
                            <input id="ContactAdress" name="ContactAdress" type="text" class="form-control" value="" />
                        </td>
                        <th class="formTitle">&nbsp;</th>
                        <td class="formValue" style="">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
</div>

